#pragma once

#include "notransformactor.h"
#include <osg\Vec4>
#include <osg\LightSource>

namespace CoreBase
{
	class Viewer;
	class Scene;
}

namespace VrDataCore
{
	class VRDATACORE_EXPORT LightActorBase:public NoTransformActor
	{
	public:
		LightActorBase();
	public:
		virtual void buildPropertyMap();
		virtual void onMapLoadBegin(CoreBase::Map*){}
		virtual void setPosition(osg::Vec3 pos);
		osg::Vec3 getPosition();
		void setDirection(osg::Vec3 direction);
		osg::Vec3 getDirection();
		void setDiffuse(osg::Vec4 diffuse);
		osg::Vec4 getDiffuse();
		void setAmbient(osg::Vec4 ambient);
		osg::Vec4 getAmbient();
		void setSpecular(osg::Vec4 specular);
		osg::Vec4 getSpecular();
		int getLightNumber();
		void setLightNumber(int lightnum);
		virtual void setActive(CoreBase::Viewer* viewer,CoreBase::Scene* scene);
		virtual void setUnactive();
		virtual void drawAsModel(bool asmodel){}
	protected:
		~LightActorBase();
		osg::Vec3											_position3;
		osg::Vec4											_position4;
		osg::Vec3											_direction;
		osg::Vec4											_diffuseColor;
		osg::Vec4											_ambientColor;
		osg::Vec4											_specularColor;
		CoreBase::Scene*									_currentScene;
		CoreBase::Viewer*									_currentView;
		osg::ref_ptr<osg::LightSource>						_lightSource;
		osg::ref_ptr<osg::Light>							_light;
		int												_lightNumber;
		bool												_isActive;
		bool												_asModel;
	};
}